******* First run  "Clean Dataset" and then "dofile2"
//Includes Table E.3

//generate chosen variable
gen flestk1=0
gen flestk2=0
gen flestk3=0


forvalues i=1/3{
	replace flestk`i'=1 if kand4_`i'==flest
}


gen minstk1=0
gen minstk2=0
gen minstk3=0

forvalues i=1/3{
	replace minstk`i'=1 if kand4_`i'==minst
}

stack ///
flestk1 minstk1 scorek4_1 genk4_1 id totparscorek4_1 ///
flestk2 minstk2 scorek4_2 genk4_2 id totparscorek4_2 ///
flestk3 minstk3 scorek4_3 genk4_3 id totparscorek4_3, ///
into(flest minst score gender id totparscore) clear

label var gender "Female"
label var score "Score Part 3"
label var totparscore "Pair Score"

qui clogit flest gender score totparscore, robust group(id)
eststo n1

qui clogit minst gender score totparscore, robust group(id)
eststo n2

esttab n1 n2 using tablea5.tex, eform se  /// 
label  ///
 nodepvars nomtitles nonotes ///  
star(* 0.10 ** 0.05 *** 0.01) addnotes ///
("Notes: Clogit regressions. The dataset is part 4 on long" ///
"form. The dependent variable is \textit{chosen}. Model 1 " ///
"is category Best and model 2 is category Worst. The top " ///
"panel reports coefficients, standard errors are robust." /// 
"*, **, and *** denote significance at the 10%, 5% and 1%" ///
"level. The lower panel indicates the number of observations.") ///
gap eqlabels(none) collabels(,lhs(Dep Var: Chosen))  replace


